const jwt:any = require('jsonwebtoken');
const serect:any = 'token';  //密钥，不能丢
module.exports = (userinfo) => {
    // console.log(userinfo)
    const token = jwt.sign({
        user: userinfo.name,
        id: userinfo.id
    }, serect, {expiresIn: '1d'});
    return token;
};
export {}